UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Eibq5FZE/JRahh6TBWMnzDhxZj4+i6ifuLwwrm6c2yg=' 
WHERE 
  key_id = '750ca714b8f2c15e0a62c0ff689da34745863fe49e6001e9d0bdc64c4c078da5' 
  AND (
    token = 'Eibq5FZE/JRahh6TBWMnzDhxZj4+i6ifuLwwrm6c2yg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069