UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UALrLnY44wQjPCeeu9Dvb5M7Odl03vnH8IMVk5Cqo5A=' 
WHERE 
  key_id = '85a68641cc2c2b598e87dd197386145844f8a2c16f2dcf614f90ab1c271624b2' 
  AND (
    token = 'UALrLnY44wQjPCeeu9Dvb5M7Odl03vnH8IMVk5Cqo5A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038