UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z1FNE10SQp1BnJHqxoq9XwNfsN07i15g9XZPVkJTf5Q=' 
WHERE 
  key_id = '0b08b48adeafe1893c4d5aed1a860dccad7cca8dee4dd97af7370025af4df99b' 
  AND (
    token = 'z1FNE10SQp1BnJHqxoq9XwNfsN07i15g9XZPVkJTf5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026