UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Pxe/PWWUG912G+FFpbzWQrtjknBI/5E4TPov3NShKQ=' 
WHERE 
  key_id = 'abe64d9f6b01391c45343a58f1be77941641b981ab8da0cc2474261bf5341056' 
  AND (
    token = '0Pxe/PWWUG912G+FFpbzWQrtjknBI/5E4TPov3NShKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026