UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jYtHeCdTT4L1q34EQExAkpJ2SEoaupXA33oQ3xMaRqA=' 
WHERE 
  key_id = '690dbebe2b2957a025220c42a875bc77b38b9e70f0566c3f6eb862265426ee5c' 
  AND (
    token = 'jYtHeCdTT4L1q34EQExAkpJ2SEoaupXA33oQ3xMaRqA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048