UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AktifDcfvMrSPO76NAKYYj2ZvDnCXJxTm5l6Z7HMCMg=' 
WHERE 
  key_id = '8c74dec3794530a5678b20ae174f456af586d99321ad484650903cc03ed85cf3' 
  AND (
    token = 'AktifDcfvMrSPO76NAKYYj2ZvDnCXJxTm5l6Z7HMCMg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039