UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XjGMFQ0g/Lzj+4XZCLVR5wU4G4w+d84M+rsP+1PGwc0=' 
WHERE 
  key_id = '7ec2c0cd374abc10972f8519fbf8cf4fa8fdf1cb273f9b8c18a3bf8e6847b295' 
  AND (
    token = 'XjGMFQ0g/Lzj+4XZCLVR5wU4G4w+d84M+rsP+1PGwc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047