UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9z38rFmnvVMgv4fnYDQ4HXFq4R3Wqcf3yXt+nAj8Fog=' 
WHERE 
  key_id = '2bce8b97f827350188a37882dd56cd6a35c2ff04863d9f7e338b35e08ef4b3cb' 
  AND (
    token = '9z38rFmnvVMgv4fnYDQ4HXFq4R3Wqcf3yXt+nAj8Fog=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033