UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oowGPBg4Y0f0APqY9f1GbR7n9POuIoHfm0QrYJpCPis=' 
WHERE 
  key_id = '9bbe238bf77d3a2bb0ef3cb0f8dca445269001f9fb19eb7dedbf046bd8d9cd51' 
  AND (
    token = 'oowGPBg4Y0f0APqY9f1GbR7n9POuIoHfm0QrYJpCPis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051