UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ve84e+adrGnM6X990/rlEn1JfCClddeWogd0SamHEsE=' 
WHERE 
  key_id = '3d381555ccfb2be6e93ba5dcd2973ceb4d9b6a953c4833980198538e0c8384fd' 
  AND (
    token = 'Ve84e+adrGnM6X990/rlEn1JfCClddeWogd0SamHEsE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019