UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TyI9wR2dnIEQNCKVg72Y0Y7FP/Pl06OKspCN0XPLlvk=' 
WHERE 
  key_id = 'e3e6466f3ccfad65ebe985f1cec7195a5a69c9045bf6ef873eb6d0739137fd55' 
  AND (
    token = 'TyI9wR2dnIEQNCKVg72Y0Y7FP/Pl06OKspCN0XPLlvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022