UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e4LRPbBjB3mluFyag4UrSpIgUJ98MoiDWGDvHJCGD1s=' 
WHERE 
  key_id = '59e01ea81e1ece5182e84b7fef3c5d5f54e24c547380e620b61b41b6ee0f723d' 
  AND (
    token = 'e4LRPbBjB3mluFyag4UrSpIgUJ98MoiDWGDvHJCGD1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029