UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kV4Lv4IzA0XKR8XzLDBG7vX+v0Q4q1FQHlWnzO+COBY=' 
WHERE 
  key_id = '15aa5d9ff6dc0f777315fbf6cec284a0227b7cc4d865fd3d96ce3e60d2d2e085' 
  AND (
    token = 'kV4Lv4IzA0XKR8XzLDBG7vX+v0Q4q1FQHlWnzO+COBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031