UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pkngS6H5OLHHoqYG+RGcyEYfz0L+88VWLP4H1aw5yOQ=' 
WHERE 
  key_id = 'ac638a85a6366166a76e1e2ba1504261b4bc84019af154ecb446d91c317ca0a7' 
  AND (
    token = 'pkngS6H5OLHHoqYG+RGcyEYfz0L+88VWLP4H1aw5yOQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029