UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ShYIC3p6JAeYiTEv2zvOkJs/1zSza5Co80wPr6kNM0E=' 
WHERE 
  key_id = '295502b2d784fbd168394b92d78e7b872b4363315711c465a7dfcd85ae06a00b' 
  AND (
    token = 'ShYIC3p6JAeYiTEv2zvOkJs/1zSza5Co80wPr6kNM0E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00086