UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mvvw4qgbyaeUSweB8nDZeWNywOjPnLVpDsUBQOVN76g=' 
WHERE 
  key_id = 'ca345ad496795cfcab22aa66ea35539fdec5b4b4b3491b5d5ca6fe5b3e310242' 
  AND (
    token = 'Mvvw4qgbyaeUSweB8nDZeWNywOjPnLVpDsUBQOVN76g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047