UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cZpBSkm4awl15nQN4dmAfIjxB3GB/f8T1wPU4IXGlEs=' 
WHERE 
  key_id = 'bdb10535372ce751cf376bddaeb2ee8c8c48c61bc7265a9ad0429ff2f85e3d5f' 
  AND (
    token = 'cZpBSkm4awl15nQN4dmAfIjxB3GB/f8T1wPU4IXGlEs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059