UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xqK5O59xYUbIyJ9vR15Y6bU7n3FnwddnzaZd+1NQmNE=' 
WHERE 
  key_id = '7beb614be12476e66051b3822dd5c754fd56e4eb79f1d8d80662e4e4554f1f41' 
  AND (
    token = 'xqK5O59xYUbIyJ9vR15Y6bU7n3FnwddnzaZd+1NQmNE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057