UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HQQ6crH4jCifRv7JpHiTI35sELiKIli1dSOppsNc2ww=' 
WHERE 
  key_id = '8500ca459cd502c5d2428515c4ad67640f65e562ff485c0a4f04cfee5013424c' 
  AND (
    token = 'HQQ6crH4jCifRv7JpHiTI35sELiKIli1dSOppsNc2ww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041