UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VuRRt4K9fbvV+oiqPpHEIQjrJXD5Gz3xV3sVnSogQVQ=' 
WHERE 
  key_id = '70ac664f1736ad00425e54e9f1362c788a150967de6bb4b81049700fc241a7cb' 
  AND (
    token = 'VuRRt4K9fbvV+oiqPpHEIQjrJXD5Gz3xV3sVnSogQVQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026