UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ifqs2E/wg3Zt1HH5Vx2jj12v6SwFUKO+TWGodSb9s2Q=' 
WHERE 
  key_id = 'b1d1f76d1acafbc1ee4d0d8befd6a7c2cd1c7e59af2ba0da006c34309d10d48d' 
  AND (
    token = 'ifqs2E/wg3Zt1HH5Vx2jj12v6SwFUKO+TWGodSb9s2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035