UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KYKlNmO4yWHAkdxdYKk4Otl+vL1wPh35qIbIgnF/quM=' 
WHERE 
  key_id = '2b03aa6cce1065f977eacb6409ebec7d1154f2ee5e3a001e39de5658d9762342' 
  AND (
    token = 'KYKlNmO4yWHAkdxdYKk4Otl+vL1wPh35qIbIgnF/quM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027