UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4F6b4X1HVhQGUsUuRJODVrwBbiI9zkDLZmYNoPYECLA=' 
WHERE 
  key_id = '75d796e02b3b4e96ef0ce337c7c6735ec3542c78caf5c759d591cc540a25bd79' 
  AND (
    token = '4F6b4X1HVhQGUsUuRJODVrwBbiI9zkDLZmYNoPYECLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026