UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'skECj4rLKVLmt3veP9uU8B6txF6UoDD+qhWQWXwMYps=' 
WHERE 
  key_id = '4681549a3ff58a6e5dea071e506910159515996b770f5122dcf37bc9c873d9b4' 
  AND (
    token = 'skECj4rLKVLmt3veP9uU8B6txF6UoDD+qhWQWXwMYps=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021