UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5So54Zfx9fJypdy+eSrOgXyiDIVyUD8xFHkIM3EmoiM=' 
WHERE 
  key_id = 'b610a8112efb7f6b8cbb4abafcf7e2cee952f087e77d71ff70285c99852fd275' 
  AND (
    token = '5So54Zfx9fJypdy+eSrOgXyiDIVyUD8xFHkIM3EmoiM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032