UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bz/HTC9HQch3jb6DDPHoFl9zAHNOGGDA2J+5w4TkpwQ=' 
WHERE 
  key_id = '4f57c3d86d7ce08bf8557d3651fed00e91eeeaaee6dd0947d35cc77dd82978bc' 
  AND (
    token = 'Bz/HTC9HQch3jb6DDPHoFl9zAHNOGGDA2J+5w4TkpwQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022