UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '51QrjJ5fU96YlTFUHy9SlZpugYz/r80k0mmx9pIuH5s=' 
WHERE 
  key_id = 'c6df73dbca422d8fa9aa9d11f38e2eea83e57790385c2ccfe829063937f8229e' 
  AND (
    token = '51QrjJ5fU96YlTFUHy9SlZpugYz/r80k0mmx9pIuH5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045