UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b2MQz//RFkLomgCkNB5PhawoUzB4BworbR9BX1YimUg=' 
WHERE 
  key_id = '76daf7e4c1f5c276328b3eb3548cbb48d68c1fdbe47331ec41659e6dea0333eb' 
  AND (
    token = 'b2MQz//RFkLomgCkNB5PhawoUzB4BworbR9BX1YimUg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020