UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bf9P3JSIt67OJsJcVsscYMTB19T4c5LEg++CdtTqF+g=' 
WHERE 
  key_id = '06efec62573049e0c98c96013883a983e030976cf9bf26ccf1712d49ac4cbb65' 
  AND (
    token = 'Bf9P3JSIt67OJsJcVsscYMTB19T4c5LEg++CdtTqF+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041