UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oc3hg6ZH+dGFMKvnojFFwScGdhKcem5lAkQQfGDIbfg=' 
WHERE 
  key_id = 'b2be0ebd623811ab3a9fa0857828a80ac7fff179a5c17305b2a8805b40d33e3c' 
  AND (
    token = 'Oc3hg6ZH+dGFMKvnojFFwScGdhKcem5lAkQQfGDIbfg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045