UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YVwGUvU1zlVWHuD9+b3HsEmBKedu8K8ma1jkF4ayO0s=' 
WHERE 
  key_id = '5a036b41094b8a535a10f24846179d97f6c0e3ed42c528de031e0937ba10c27a' 
  AND (
    token = 'YVwGUvU1zlVWHuD9+b3HsEmBKedu8K8ma1jkF4ayO0s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069