UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1NhFdCtq9AUAzkkG3QRawE4I7/7h9X4xTbPNQTaNEIA=' 
WHERE 
  key_id = '6c89d0dc0b20da6ef5879a56219f82c893acd318b1733f994b76eb5233a18921' 
  AND (
    token = '1NhFdCtq9AUAzkkG3QRawE4I7/7h9X4xTbPNQTaNEIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037